﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.Text;
using MobileSales.Model.Orders;
using System.ServiceModel.Web;

namespace MobileSales.Server.RestServices
{
    [ServiceContract]
    public interface IOrderServiceREST
    {        
        #region Order management

        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                UriTemplate = "GetOrder/{orderId}")]
        Order GetOrder(string orderId);

        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                UriTemplate = "GetOrderList")]
        IEnumerable<Order> GetOrderList();

        [OperationContract]
        [WebInvoke(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                Method = "POST",
                UriTemplate = "StoreOrder")]
        void StoreOrder(Order order);

        #endregion

        #region Order status management

        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                UriTemplate = "GetOrderStatus/{orderStatusId}")]
        OrderStatus GetOrderStatus(string orderStatusId);

        [OperationContract]
        [WebGet(BodyStyle = WebMessageBodyStyle.Bare,
                RequestFormat = WebMessageFormat.Json,
                ResponseFormat = WebMessageFormat.Json,
                UriTemplate = "GetOrderStatusList")]
        IEnumerable<OrderStatus> GetOrderStatusList();

        #endregion
    }
}
